package dRegAut.opg2;
public class O2_4 {

    public FA createFA() {
        FA fa = new FA();
        State stateA = new State("A");
        State stateB = new State("B");
        State stateC = new State("C");
        State stateCrash = new State("Crash");

        fa.alphabet = new Alphabet("abc");

        fa.states.add(stateA);
        fa.states.add(stateB);
        fa.states.add(stateC);
        fa.states.add(stateCrash);

        fa.initial = stateA;
        fa.accept.add(stateA);
        fa.accept.add(stateC);

        fa.setTransition(stateA, 'a', stateB);
        fa.setTransition(stateA, 'b', stateC);
        fa.setTransition(stateA, 'c', stateC);

        fa.setTransition(stateB, 'a', stateCrash);
        fa.setTransition(stateB, 'b', stateC);
        fa.setTransition(stateB, 'c', stateCrash);


        fa.setTransition(stateC, 'a', stateA);
        fa.setTransition(stateC, 'b', stateC);
        fa.setTransition(stateC, 'c', stateC);

        fa.setTransition(stateCrash, 'a', stateCrash);
        fa.setTransition(stateCrash, 'b', stateCrash);
        fa.setTransition(stateCrash, 'c', stateCrash);

        return fa;
	}
}
